# a = ["1","lll","劳动节",9999,88.8,"劳动节"]


# b = [i for i in a if type(i) != str]        #1、删除列表里所有字符串对象
# print(b)

# aaa = []
# for i in a:
#     if i not in aaa:
#         aaa.append(i)                             #2、删除列表中重复的元素
# print(aaa)




# l1 = [1, 2, 3, 4, 5]

# l1.insert(3,300)
# print(l1)               #3(1) 在l1的元素3后面插入300

# l1.remove(2)
# print(l1)                   #3(2)删除元素2


# l1[4] = 500                 #3(3)将5更改为500
# print(l1)


# b = l1[1:4]                   #3（4）将2，3，4切片出来
# print(b)

# print(l1[-3:-5])                       #3(5)    l1[-3:-5]的结果:  []
#print(l1[-3:-5:-1])   #[2,3]

# print(l1[-3:])               #3(6)   :[3, 4, 5]

# names = ["张三","李四","王五","老六"]
# name = input("输入你的姓名：")         #4、通过input引导用户输入一个姓名，判断该姓名是否存在于列表names中
# if name in names:
#     print("你在列表里")
# else:
#     print("你不在列表里")


# l = [1,2,3,[4,5]]

# l[3][0] = 400                        #5(1)  将4修改为400
# print(l)
#
# l[3].insert(2,6)             #5(2)在l的[4，5]列表中追加一个6
# print(l)

# l[-1].append(6)




# l1 = [1, 2, 3, 4, 5]                                 #6、计算数值型列表的平均值是多少？
#
# b = sum(l1)/len(l1)      #整除//
# print(b)



# sum = []                                 #7、从数值型列表中，将索引位置为偶数的，挑选出来，放到一个新列表里
# for i in l1:
#     if l1.index(i)%2==0:                    #l1.index(1)
#         sum.append(i)
#
# print(sum)








# l1 = [88, 99, 101, 222, 555]
# # a = max(l1)        #内置函数
#                     #8、求出列表里最大的数是多少（不允许用sort等其他内置函数去做）,以及这个数所在的索引位置
#
# a=l1[0]        #取出默认值88
# for i in l1:
#     if i > a:
#         a = i
# print(a)
#
# print(l1.index(a))




#
# information = []            #9、学生管理系统
# while True:
#     print("欢迎来到学生管理系统：")
#     print("功能菜单如下：")
#     print("①、添加学生信息")
#     print("②、删除学生信息")
#     print("③、修改学生信息")
#     print("④、显示学生信息")
#     print("⑤、退出系统")
#
#
#     input_01 = input("请输入您要选择的功能选项：")
#     if input_01 == "1":
#         name = input("输入要添加的学生姓名：")
#         if name not in information:
#             information.append(name)
#             print(f"添加成功：{name}")
#         else:
#             print(f"{name}已存在")
#     elif input_01 == "2":
#         name = input("输入要删除的学生姓名：")
#         if name in information:
#             information.remove(name)
#             print(f"{name}删除成功")
#         else:
#             print(f"{name}删除失败，不存在该姓名")
#     elif input_01 =="3":
#         name_old = input("输入要修改的学生姓名：")
#         if name_old in information:
#             name_new = input("输入更改后的新名字：")
#             for i in range(len(information)):
#                 if information[i] == name_old:
#                     information[i] = name_new
#             print(f"原名字：{name_old}，现已更改为：{name_new}")
#         else:
#             print(f"更改失败，原名字{name_old}不存在")
#     elif input_01 == "4":
#         for index,values in enumerate(information):
#             print(f"查询到的学生姓名为：{values},列位为：{index+1}")
#     elif input_01 == "5":
#         print("再见")
#         break
#
#
#









#
# input_01 = input("请输入一个字符串：")          #10、传入的string中,计算数字、字母、空格、其它内容的个数
#
# number = 0
# character = 0
# space = 0
# other = 0
#
# for i in input_01:
#     if i in "0123456789":
#         number = number+1
#     elif (i>="a" and i<="z") or (i>="A" and i <="Z"):
#         character = character+1
#     elif i in " ":
#         space = space+1
#     else:
#         other = other+1
# print(f"数字有{number}，字母有{character}，空格有{space}，其他有{other}")




#
# print(sum(range(1,101)))                                    #11、一行代码实现1~100的和
# print(sum([i for i in range(1, 101)]))

#
# a = ["1", "lll", "劳动节", 9999, 88.8, "劳动节"]                    #12、删除重复
# num = []
# for i in a:
#     if i not in num:
#         num.append(i)
# print(num)







import random

# mun = []
# a = "0123456789"
# b = ""
#
# while True:              #13、从0~9的十个数字中随机取出4个不重复的数字组成一个字符串，将四个字符串放入列表中
#     number = random.choice(a)
#     if number not in b:
#         b = b+number
#     if number[0] =="0":
#         b = b[1:]
#     if len(b) >= 4:
#         mun.append((b[0:4]))
#         b = ""
#     if len(mun) == 4:
#         break
#
# print(mun)







#
# s = input("请输入数字：")            #14、判断输入的数字是否大于150
# if int(s) >  150:
#     print("你输入的数字大于150")
# elif int(s) <= 150:
#     print("你输入的数字小于等于150")
# else:
#     print("输入的数字格式有误，请输入数字")













